package com.Chicken_bird_relationship;

public class Test_getCategory {
    public static void main(String[] args) {
        fowl f = new fowl();
        Test_Category(f);

//        bird b = new bird();
//        Test_Category(b);
    }

    static void Test_Category(Object obj){
        if(obj instanceof bird b){
            System.out.println(b.getCategory());
        }
        else if(obj instanceof fowl f){
            System.out.println(f.getCategory());
        }
    }
}
